<ion-view view-title="商品问答" class="wenda">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button></ion-nav-back-button>
	</ion-nav-bar>
	
	<div class="bar bar-subheader padding-0">
		<div class="row top">
			<div class="col" on-tap="activeSlide(0)">
				<div ng-class="selectIndex==0?'top-activated':''">待回答</div>
			</div>
			<div class="col" on-tap="activeSlide(1)">
				<div ng-class="selectIndex==1?'top-activated':''">已回答</div>
			</div>
		</div>
	</div>
	

	<!--描述：滑动块-->
	<ion-content class="has-header has-subheader bg">

		<ion-slide-box delegate-handle="tab-handle" on-touch="onTouch()" on-release="onRelease()" draw-slide="false" on-slide-changed="slideChanged(index)" active-slide="slideIndex" show-pager="false">

			<!--待问答 ng-style="myObj"-->
			<ion-slide>
				<ion-scroll direction="y" id="wait" ng-style="myObj" lazy-scroll>
					<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
					
					<!--没有数据firstHide-->
					<div class="noData" ng-if="!datasArr[0].consult">
						<img src="./img/guilin/other/icon_noAnswer@2x.png" />
						<div class="tip">没有待回答的问题！</div>
					</div>
					
						<div class="list">
							<li class="item item-text-wrap" ng-repeat="consult in datasArr[0].consult">
								<div class="time">{{consult.time}}</div>
								<!--问题-->
								<div class="row">
									<div class="wenCol">
										<div class="wen">问</div>
									</div>
									<div class="col questionCol">
										{{consult.comment}}
									</div>
								</div>
								<!--商品-->
								<div class="goodsDiv">
									<img src="{{consult.goods_image||noImg}}" class="imgDiv" />
									<div class="nameDiv">
										{{consult.goods_name}}
									</div>
								</div>
								<div class="btnDiv" ng-if="!consult.isShowReplyInput">
									<div class="gray" on-tap="deleteWenDa(consult.comment_id)">删除</div>
									<div class="blue" on-tap="showReplyInput($index)">回复</div>
								</div>
								<!--输入框-->
								<div class="repayInputDiv" ng-if="consult.isShowReplyInput">
									<textarea rows="3" placeholder="请输入内容最多1000字" ng-model="input.reply_content"></textarea>
									<div class="btns">
										<div class="basebtn blue" on-tap="submit()">确定</div>
										<div class="basebtn gray" on-tap="showReplyInput($index)">取消</div>
									</div>
								</div>
							</li>
						</div>
					<ion-infinite-scroll ng-if="!isLoad&&datasArr[0].page.tPage>datasArr[0].page.cPage" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
				</ion-scroll>
			</ion-slide>
			
			
			<!--已回答-->
			<ion-slide>
				<ion-scroll direction="y" id="already" ng-style="myObj" lazy-scroll>
					<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
					
					<!--没有数据-->
					<div class="noData" ng-if="!datasArr[1].consult">
						<img src="./img/guilin/other/icon_noAnswer@2x.png" />
						<div class="tip">没有已回答的问题！</div>
					</div>
					
					<div class="list">
							<!--问-->
							<li class="item item-text-wrap" ng-repeat="consult in datasArr[1].consult">
								<div class="time">{{consult.time}}</div>
								<!--问题-->
								<div class="row">
									<div class="wenCol">
										<div class="wen">问</div>
									</div>
									<div class="col questionCol">
										{{consult.comment}}
									</div>
								</div>
								<!--商品-->
								<div class="goodsDiv">
									<img src="{{consult.goods_image||noImg}}" class="imgDiv" />
									<div class="nameDiv">
										{{consult.goods_name}}
									</div>
								</div>
								<!--查看回复-->
								<div class="btnDiv chakan" on-tap="showReply($index)">
									查看回复&nbsp;
									<img src="{{consult.isShowReply?'./img/guilin/common/icon_up@2x.png':'./img/guilin/common/icon_down@2x.png'}}" width="11"/>
								</div>
								<div class="replyDiv" ng-if="consult.isShowReply" ng-repeat="answer in consult.answer">
									<div class="replyTime">
										<span class="tip">店家回复</span>
										{{answer.time}}
									</div>
									{{answer.comment}}
								</div>
								
								<div class="btnDiv border" ng-if="!consult.isShowReplyInput">
									<div class="gray" on-tap="deleteWenDa(consult.comment_id)">删除</div>
									<div class="blue" on-tap="showReplyInput($index)">回复</div>
								</div>
								<!--输入框-->
								<div class="repayInputDiv" ng-if="consult.isShowReplyInput">
									<textarea rows="3" placeholder="请输入内容最多1000字" ng-model="input.reply_content"></textarea>
									<div class="btns">
										<div class="basebtn blue" on-tap="submit()">确定</div>
										<div class="basebtn gray" on-tap="showReplyInput($index)">取消</div>
									</div>
								</div>
							</li>
						</div>
					
					<!--描述：当用户到达页脚或页脚附近时-->
					<ion-infinite-scroll ng-if="!isLoad&&datasArr[1].page.tPage>datasArr[1].page.cPage" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
				</ion-scroll>
			</ion-slide>
			
		</ion-slide-box>
	</ion-content>
</ion-view>